#!/bin/bash

# Navigate to the functions directory
cd backend/functions || exit

# Install dependencies if node_modules doesn't exist
if [ ! -d "node_modules" ]; then
    echo "Installing dependencies..."
    npm install
fi

# Build the TypeScript code
echo "Building TypeScript code..."
npm run build

# Start the application
echo "Starting the application..."
npm start